home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / Src / Ch1 / Fills.frm (.txt) < prev    next >
Visual Basic Form  |  1999-03-19  |  4KB  |  127 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFills 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "Fills"
  5.    ClientHeight    =   3150
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   5535
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   3150
  11.    ScaleWidth      =   5535
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.Label lblStyle 
  14.       Alignment       =   2  'Center
  15.       BackStyle       =   0  'Transparent
  16.       Caption         =   "vbDiagonalCross"
  17.       Height          =   255
  18.       Index           =   7
  19.       Left            =   2820
  20.       TabIndex        =   7
  21.       Top             =   2040
  22.       Width           =   1695
  23.    End
  24.    Begin VB.Label lblStyle 
  25.       Alignment       =   2  'Center
  26.       BackStyle       =   0  'Transparent
  27.       Caption         =   "vbCross"
  28.       Height          =   255
  29.       Index           =   6
  30.       Left            =   1020
  31.       TabIndex        =   6
  32.       Top             =   2040
  33.       Width           =   1695
  34.    End
  35.    Begin VB.Label lblStyle 
  36.       Alignment       =   2  'Center
  37.       BackStyle       =   0  'Transparent
  38.       Caption         =   "vbDownwardDiagonal"
  39.       Height          =   255
  40.       Index           =   5
  41.       Left            =   3720
  42.       TabIndex        =   5
  43.       Top             =   1080
  44.       Width           =   1695
  45.    End
  46.    Begin VB.Label lblStyle 
  47.       Alignment       =   2  'Center
  48.       BackStyle       =   0  'Transparent
  49.       Caption         =   "vbUpwardDiagonal"
  50.       Height          =   255
  51.       Index           =   4
  52.       Left            =   1920
  53.       TabIndex        =   4
  54.       Top             =   1080
  55.       Width           =   1695
  56.    End
  57.    Begin VB.Label lblStyle 
  58.       Alignment       =   2  'Center
  59.       BackStyle       =   0  'Transparent
  60.       Caption         =   "vbVerticalLine"
  61.       Height          =   255
  62.       Index           =   3
  63.       Left            =   120
  64.       TabIndex        =   3
  65.       Top             =   1080
  66.       Width           =   1695
  67.    End
  68.    Begin VB.Label lblStyle 
  69.       Alignment       =   2  'Center
  70.       BackStyle       =   0  'Transparent
  71.       Caption         =   "vbHorizntalLine"
  72.       Height          =   255
  73.       Index           =   2
  74.       Left            =   3720
  75.       TabIndex        =   2
  76.       Top             =   120
  77.       Width           =   1695
  78.    End
  79.    Begin VB.Label lblStyle 
  80.       Alignment       =   2  'Center
  81.       BackStyle       =   0  'Transparent
  82.       Caption         =   "vbFSTransparent"
  83.       Height          =   255
  84.       Index           =   1
  85.       Left            =   1920
  86.       TabIndex        =   1
  87.       Top             =   120
  88.       Width           =   1695
  89.    End
  90.    Begin VB.Label lblStyle 
  91.       Alignment       =   2  'Center
  92.       BackStyle       =   0  'Transparent
  93.       Caption         =   "vbFSSolid"
  94.       Height          =   255
  95.       Index           =   0
  96.       Left            =   120
  97.       TabIndex        =   0
  98.       Top             =   120
  99.       Width           =   1695
  100.    End
  101. Attribute VB_Name = "frmFills"
  102. Attribute VB_GlobalNameSpace = False
  103. Attribute VB_Creatable = False
  104. Attribute VB_PredeclaredId = True
  105. Attribute VB_Exposed = False
  106. Option Explicit
  107. ' Draw boxes using different DrawStyle values.
  108. Private Sub Form_Load()
  109. Const GAP = 120
  110. Dim i As Single
  111. Dim wid As Single
  112. Dim hgt As Single
  113. Dim X As Single
  114. Dim Y As Single
  115.     ' Make changes permanent.
  116.     AutoRedraw = True
  117.     ' Draw the boxes.
  118.     wid = lblStyle(0).Width
  119.     hgt = 5 * 120
  120.     For i = 0 To lblStyle.UBound
  121.         FillStyle = i
  122.         X = lblStyle(i).Left
  123.         Y = lblStyle(i).Top + lblStyle(i).Height
  124.         Line (X, Y)-Step(wid, hgt), , B
  125.     Next i
  126. End Sub
  127.